using UnityEngine;
using QFramework;

namespace ProjectSurvivor
{
	public partial class FXController : ViewController
	{

		private static FXController mDefalut;

        private void Awake()
        {
            mDefalut = this;
        }


        private void OnDestroy()
        {
            mDefalut=null;
        }


        public static void Play(SpriteRenderer sprite,Color dissolveColor)
        {
            mDefalut.EnemyDieFix.Instantiate()
                .Position(sprite.Position())
                .LocalScale(sprite.Scale())
                .Self(s =>
                {
                    s.GetComponent<Dissolve>().DissolveColor = dissolveColor;
                    s.sprite = sprite.sprite;
                }).Show();

        }


    }
}
